<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML>
<html>
<head>
  <title>后台管理系统</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="/resources/css/dpl-min.css" rel="stylesheet" type="text/css" />
  <link href="/resources/css/bui-min.css" rel="stylesheet" type="text/css" />
  <link href="/resources/css/page-min.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div class="container">
  <form id="J_Form" class="form-horizontal" action="/member/save">

    <h3>团队业绩</h3>
   <input type="hidden" name="id" id="id" value="${id}"/>
    <h2>会员统计</h2>
    <div class="row">
      <div class="control-group span12">
        <label class="control-label">会员总数：</label>
        <div style="display:inline;height:40px;margin-left: 10px;" >
          <span id="memberCnt" onclick="viewMember(0)" style="cursor: pointer">0</span>
        </div>
      </div>

    </div>

    <div class="row">
      <div class="control-group span12">
        <label class="control-label">普通会员：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          <span  id="userCnt" onclick="viewMember(1)" style="cursor: pointer">0</span>
        </div>
      </div>
    </div>

    <div class="row">
      <div class="control-group span12">
        <label class="control-label">金牌代理：</label>
        <div style="display:inline;height:40px;margin-left: 10px;" >
          <span  id="goldCnt" onclick="viewMember(2)" style="cursor: pointer">0</span>
        </div>
      </div>
    </div>



    <div class="row">
      <div class="control-group span12">
        <label class="control-label">全国总代：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          <span  id="generalCnt" onclick="viewMember(3)" style="cursor: pointer">0</span>
        </div>
      </div>
    </div>

    <div class="row">
      <div class="control-group span12">
        <label class="control-label">区域合伙人：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          <span  id="partnerCnt" onclick="viewMember(4)" style="cursor: pointer">0</span>
        </div>
      </div>

    </div>
    <h2>订单统计</h2>
    <div class="row">
      <div class="control-group span12">
        <label class="control-label">订单总数：</label>
        <div style="display:inline;height:40px;margin-left: 10px;" >
          <span  id="orderCnt" onclick="viewOrder(2)"  style="cursor: pointer">0</span>
        </div>
      </div>

    </div>

    <div class="row">
      <div class="control-group span12">
        <label class="control-label">购物订单数：</label>
        <div style="display:inline;height:40px;margin-left: 10px;" >
          <span  id="gwOrderCnt" onclick="viewOrder(0)" style="cursor: pointer">0</span>
        </div>
      </div>
    </div>

    <div class="row">
      <div class="control-group span20">
        <label class="control-label">升级订单数：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          <span  id="sjOrderCnt" onclick="viewOrder(1)" style="cursor: pointer">0</span>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="control-group span20">
        <label class="control-label">总业绩：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          <span  id="yjTotal" onclick="viewOrder(2)" style="cursor: pointer">0</span>
        </div>
      </div>
    </div>


    <div class="row form-actions actions-bar">
      <div class="span13 offset3 ">
       <button type="button" class="button" onclick="back()">返回</button>
      </div>
    </div>
  </form>
</div>
<script type="text/javascript" src="/resources/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="/resources/js/bui-min.js"></script>
<script type="text/javascript" src="/resources/js/config-min.js"></script>


<script type="text/javascript">
  BUI.use('common/page'); //页面链接跳转
  BUI.use(['bui/tree','bui/form','bui/select','bui/data','bui/mask'],function (Tree,Form,Select,Data,Mask) {

    var fullMask = new Mask.LoadMask({
      el : 'body',
      msg : '数据加载中...'
    });
    fullMask.show();

    $.ajax({
      url:"/member/loadTeamYjData?r="+Math.random(),
      type:"post",
      data:{
        id:$("#id").val()
      },
      success:function(res){
        fullMask.hide();
        if(res.success){
          $("#memberCnt").html(res.data.memberCnt);
          $("#userCnt").html(res.data.userCnt);
          $("#goldCnt").html(res.data.goldCnt);
          $("#generalCnt").html(res.data.generalCnt);
          $("#partnerCnt").html(res.data.partnerCnt);

          $("#orderCnt").html(res.data.orderCnt);
          $("#gwOrderCnt").html(res.data.gwOrderCnt);
          $("#sjOrderCnt").html(res.data.sjOrderCnt);
          $("#yjTotal").html(res.data.yjTotal);
        }
      },
      error:function(){}
    })
  });

  function back(){
    top.topManager.openPage({
      id : "user_list",
      isClose : true
    });
    top.topManager.reloadPage("user_list");
  }

  $(function(){

  })

  function viewMember(i){
    top.topManager.openPage({id:"viewuserdetail",href:"/member/teamMember?index="+i+"&id="+$("#id").val(),title:"查看团队"});
  }

  function viewOrder(i){
    top.topManager.openPage({id:"vieworderdetail",href:"/member/teamOrder?index="+i+"&id="+$("#id").val(),title:"查看团队订单"});
  }

</script>

</body>
</html> 